#ifndef __MY_LEVEL_H__
#define __MY_LEVEL_H__

// 日志等级类设计
// 1、枚举出日志等级
// 2、提供日志等级转换接口
namespace Level
{
    class LogLevel
    {
    public:
        enum value
        {
            UNKNOW = 0,
            DEBUG,
            INFO,
            WARN,
            ERROR,
            FATAL,
            OFF
        };
        static const char *toString(value Level)
        {
            switch (Level)
            {
            case DEBUG:
                return "DEBUG";
            case INFO:
                return "INFO";
            case WARN:
                return "WARN";
            case ERROR:
                return "ERROR";
            case FATAL:
                return "FATAL";
            case OFF:
                return "OFF";
            }
            return "UNKNOW";
        }
    };
}
#endif